package com.lanswon.entity;

import java.text.SimpleDateFormat;
import java.util.Date;

import com.lanswon.common.enums.ActivityStatus;

public class Activity {
    private Long id;

    private String title;

    private Date releaseTime;
    
    private String releaseTimeStr;

    private Integer readNum;

    private Date createTime;

    private Date updateTime;

    private Integer type;

    private Integer status;

    private String statusStr;
    
    private String logoUrl;

    private String content;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title == null ? null : title.trim();
    }

    public Date getReleaseTime() {
        return releaseTime;
    }

    public void setReleaseTime(Date releaseTime) {
        this.releaseTime = releaseTime;
    }

    public String getReleaseTimeStr() {
    	if(this.releaseTimeStr==null) {
    		releaseTimeStr = new SimpleDateFormat("yyyy-MM-dd").format(this.getReleaseTime());
    	}else {
    		releaseTimeStr = this.releaseTimeStr;
    	}
		return releaseTimeStr;
	}

    public void setReleaseTimeStr(String releaseTimeStr) {
		this.releaseTimeStr = releaseTimeStr;
	}
    
    
    public Integer getReadNum() {
        return readNum;
    }

    public void setReadNum(Integer readNum) {
        this.readNum = readNum;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    
    
    public String getStatusStr() {
		return statusStr = ActivityStatus.getValueByCode(this.getStatus());
	}

	public void setStatusStr(String statusStr) {
		this.statusStr = statusStr;
	}

	public String getLogoUrl() {
        return logoUrl;
    }

    public void setLogoUrl(String logoUrl) {
        this.logoUrl = logoUrl == null ? null : logoUrl.trim();
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content == null ? null : content.trim();
    }
}